{extend name="base" /}
{block name="css"}
<style>
    font{
        color: #cc0000;
    }
</style>
{/block}
{block name="content"}
<!--tab标签-->
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li class=""><a href="{:url('admin/tbb/index')}">通报表</a></li>
                <li class="layui-this">编辑</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <form class="layui-form" action="{:url('admin/tbb/update')}" method="post">
                        <div class="layui-form-item">
                            <label class="layui-form-label">单位</label>
                            <div class="layui-input-block">
                                <input type="text" name="name" value="{$record.name}" required  lay-verify="required" placeholder="请输入单位名称" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">行政完成率</label>
                            <div class="layui-input-block">
                                <input type="text" name="xzwcl" value="{$record.xzwcl}" required  lay-verify="required" placeholder="请输入行政完成率" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">行政挂旗</label>
                            <div class="layui-input-block">
                                <select name="xzgq" lay-verify="required" lay-search="">
                                    <option value="0" {if condition="$record.xzgq==0"} selected="selected"{/if}>不挂旗</option>
                                    <option value="1" {if condition="$record.xzgq==1"} selected="selected"{/if}>红旗</option>
                                    <option value="2" {if condition="$record.xzgq==2"} selected="selected"{/if}>黄旗</option>
                                    <option value="3" {if condition="$record.xzgq==3"} selected="selected"{/if}>黑旗</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">刑事完成率</label>
                            <div class="layui-input-block">
                                <input type="text" name="xswcl" value="{$record.xswcl}" required  lay-verify="required" placeholder="请输入行政完成率" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">刑事挂旗</label>
                            <div class="layui-input-block">
                                <select name="xsgq" lay-verify="required" lay-search="">
                                    <option value="0" {if condition="$record.xsgq==0"} selected="selected"{/if}>不挂旗</option>
                                    <option value="1" {if condition="$record.xsgq==1"} selected="selected"{/if}>红旗</option>
                                    <option value="2" {if condition="$record.xsgq==2"} selected="selected"{/if}>黄旗</option>
                                    <option value="3" {if condition="$record.xsgq==3"} selected="selected"{/if}>黑旗</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="id" value="{$record.id}">
                                <button class="layui-btn" lay-submit lay-filter="*">更新</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script>
    layui.use(['form'], function(){
        var form = layui.form;

        /**
         * 通用表单提交(AJAX方式)
         */
        form.on('submit(*)', function (data) {
            $.ajax({
                url: data.form.action,
                type: data.form.method,
                data: $(data.form).serialize(),
                success: function (info) {
                    if (info.code === 1) {
                        setTimeout(function () {
                            location.href = info.url;
                        }, 1000);
                    }
                    layer.msg(info.msg);
                }
            });

            return false;
        });

    });
</script>
{/block}
